package com.eling.elcms.cater.model;

import com.eling.elcms.core.dao.annotation.In;
import com.eling.elcms.core.model.BaseModel;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.IndexedEmbedded;

import javax.persistence.*;

/**
 * 用餐消费记录  的详情
 * @author Liuyp
 *
 */
@Indexed
@Table(name = "cate_mealRecord")
@Entity
public class MealRecord extends BaseModel{

	private static final long serialVersionUID = 7412514626013824359L;

	@Id
	@In
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@DocumentId
	private Long pkMealRecord;
	
	/** 顾客帐户 流水*/
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pktravelAccountFlow")
	@IndexedEmbedded(depth = 1)
	private TravelAccountFlow travelAccountFlow;
	
	/** 菜品*/
	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="PkDish")
	@IndexedEmbedded(depth = 1)
	private Dish dish;
	
	/** 菜品数量*/
	@Column
	private Integer count;

	public Long getPkMealRecord() {
		return pkMealRecord;
	}

	public void setPkMealRecord(Long pkMealRecord) {
		this.pkMealRecord = pkMealRecord;
	}

	public TravelAccountFlow getTravelAccountFlow() {
		return travelAccountFlow;
	}

	public void setTravelAccountFlow(TravelAccountFlow travelAccountFlow) {
		this.travelAccountFlow = travelAccountFlow;
	}

	public Dish getDish() {
		return dish;
	}

	public void setDish(Dish dish) {
		this.dish = dish;
	}

	public Integer getCount() {
		return count;
	}

	public void setCount(Integer count) {
		this.count = count;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
}
